﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.Concurrent;

namespace yule.Common.Cache
{
    /*
    /// <summary>
    /// 默认缓存
    /// </summary>
    internal class DefaultCacheStrategy : BaseCacheStrategy
    {
        private static ConcurrentDictionary<string, object> cache = new ConcurrentDictionary<string, object>();


        public override bool Set<T>(string key, T obj)
        {
            cache.AddOrUpdate(key, obj,
               (k, v) =>
               {
                   return null;
               }
            );
            return true;
        }

        public override T Get<T>(string key)
        {
            object obj = null;

            T t = default(T);

            if (cache.TryGetValue(key, out obj) == true)
            {
                t = obj as T;
            }

            return t;
        }

        public override bool Remove<T>(string key)
        {
            object obj = null;
            return cache.TryRemove(key, out obj);
        }


        public override IList<T> Get<T>()
        {
            throw new NotImplementedException();
        }

        public override bool Remove<T>()
        {
            throw new NotImplementedException();
        }
    }
    */


    internal class DefaultCacheStrategy : BaseCacheStrategy
    {

        public override bool Set<T>(string key, T obj)
        {
            throw new NotImplementedException();
        }

        public override T Get<T>(string key)
        {
            throw new NotImplementedException();
        }

        public override IList<T> Get<T>()
        {
            throw new NotImplementedException();
        }

        public override bool Remove<T>(string key)
        {
            throw new NotImplementedException();
        }

        public override bool Remove<T>()
        {
            throw new NotImplementedException();
        }
    }

}